<template>
    <h1>请上传你要处理的的医疗模型</h1>
    <el-upload
        style="margin-top: 20vh;"
        class="upload-demo"
        drag
        action="http://127.0.0.1:5000/auth/upload"
        multiple="false"
        @click="handleSuccess"
        show-file-list= false
    >
        <img class="logo" src="../assets/upload.png" alt="图片">
        <div class="el-upload__text">
            拖拽文件上传 <em>或点击上传</em>
        </div>
        <template #tip>
        <div class="el-upload__tip">
            上传nii.gz文件
        </div>
        </template>
    </el-upload>

    <el-button @click="present" type="primary" round style="margin-top: 50PX;">点击生成展示结果</el-button>
</template>
  
<script>
import axios from 'axios';

export default{
    name: 'UploadVue',
    data() {
        return {
            isUpload: false
        }
    },
    methods:{
        handleSuccess() {
            this.isUpload = true;        },
        present() {
            if (!this.isUpload) {
                alert("请先上传文件");
            }
            else {
                axios.get('http://127.0.0.1:5000/auth/upload')
            }
        }
    }
}
</script>
  
<style scoped>
/* CDN 服务仅供平台体验和调试使用，平台不承诺服务的稳定性，企业客户需下载字体包自行发布使用并做好备份。 */
@font-face {
  font-family: "阿里妈妈数黑体 Bold";font-weight: 700;src: url("//at.alicdn.com/wf/webfont/K7CSGmMimNOG/SKe3tXGBUZdX.woff2") format("woff2"),
  url("//at.alicdn.com/wf/webfont/K7CSGmMimNOG/eJEIwmgDwtZf.woff") format("woff");
  font-display: swap;
}
h1 {
    font-family: "阿里妈妈数黑体 Bold";
}
</style>